function mineReadFile (path) {
    return new Promise((resolve,reject)=>{
        //读取文件
        require('fs').readFile(path,(err,data)=>{
            if(err) reject(err);
            resolve(data);
        })
    })
} 

mineReadFile('./1.txt')
.then(value=>{
    //输出文件内容
    console.log(value.toString());
},reason=>{
    console.log(reason);
})